package com.example.demo.enums;

/**
 * @Auther Created by l.wang on 2019/1/2.
 */
public enum StatusEnum {
    NULL("null","不能为空"),START("1","启动成功"),STOP("0","停止成功"),RUNNING("running","正在动行中"),STOPPED("stopped","己经停止"),CLAZZ("clazz","找不到此类"),METHOD("method","找不到此方法");

    private String key;
    private String value;

    StatusEnum(String key, String value) {
        this.key = key;
        this.value = value;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public static StatusEnum getValue(String key){
            for(StatusEnum se:values()){
                if (se.getKey().equals(key)){
                    return se;
                }
            }
            return null;
        }
}
